import { IndexInterceptor } from '@libs/common/interceptors';
import { Body, Controller, Post, UseInterceptors } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';

import { DeviceExchangeLogService } from './device-exchange-log.service';
import {
  IndexDeviceExchangeLogDto,
  ShowDeviceExchangeLogDto,
} from './dto/device-exchange-log.dto';

@ApiTags('ATM兑换记录')
@Controller('device-exchange-log')
export class DeviceExchangeLogController {
  constructor(
    private readonly deviceExchangeLogService: DeviceExchangeLogService,
  ) {}

  @Post('index')
  @UseInterceptors(new IndexInterceptor())
  index(@Body() dto: IndexDeviceExchangeLogDto) {
    return this.deviceExchangeLogService.index(dto);
  }

  @Post('show')
  show(@Body() dto: ShowDeviceExchangeLogDto) {
    return this.deviceExchangeLogService.show(dto);
  }
}
